<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('新增项目文件')" />
	<script src="jquery.min.js"></script>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
	<form class="form-horizontal m" id="form-post-add">
		<div class="form-group">
			<label class="col-sm-3 control-label">项目名：</label>
			<div class="col-sm-8">
				<input class="form-control" type="text" name="proName" id="proName" required>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label">项目开始时间：</label>
			<div class="col-sm-8">
				<input class="form-control" type="date" name="proBgTime" id="proBgTime" required>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label">项目结束时间：</label>
			<div class="col-sm-8">
				<input class="form-control" type="date" name="proOvTime" id="proOvTime" required>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label">项目简介：</label>
			<div class="col-sm-8">
				<input class="form-control" type="text" name="proDes" id="proDes" required>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label">项目负责人：</label>
			<div class="col-sm-8">
				<input class="form-control" type="text" name="proAthor" id="proAthor" required>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label">项目施工地点：</label>
			<div class="col-sm-8">
				<input class="form-control" type="text" name="proAddress" id="proAddress" required>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label">项目类型：</label>
			<div class="col-sm-8">
				<select name="proTypeId">
					<option value="1">硬装</option>
					<option value="2">软装</option>
				</select>
			</div>
		</div>
	</form>
</div>
<th:block th:include="include :: footer" />
<script type="text/javascript">
	var prefix = ctx + "pro/file";

	$("#form-post-add").validate({
		onkeyup: false,
		rules:{
			postName:{
				remote: {
					url: ctx + "pro/file/checkFileNameUnique",
					type: "post",
					dataType: "json",
					data: {
						"proName" : function() {
							return $.common.trim($("#proName").val());
						}
					},
					dataFilter: function(data, type) {
						return $.validate.unique(data);
					}
				}
			},
			postSort:{
				digits:true
			},
		},
		messages: {
			"postName": {
				remote: "项目已经存在"
			}
		},
		focusCleanup: true
	});
	function submitHandler() {
		if ($.validate.form()) {
			$.operate.save(prefix + "/add", $('#form-post-add').serialize());
		}
	}


</script>
</body>

</html>
